<%@ include file="/common/taglibs.jsp"%>

<title><fmt:message key="restDetail.title"/></title>
<content tag="heading"><fmt:message key="restDetail.heading"/></content>

<html:form action="saveRest" method="post" styleId="restForm" onsubmit="return validateRestForm(this)">
<ul>

<html:hidden property="id"/>

    <li>
        <generalsetting:label styleClass="desc" key="restForm.restId"/>
        <html:errors property="restId"/>
        <html:text property="restId" styleId="restId" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="restForm.restName"/>
        <html:errors property="restName"/>
        <html:text property="restName" styleId="restName" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="restForm.restCategory"/>
        <html:errors property="restCategory"/>
        <html:text property="restCategory" styleId="restCategory" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="restForm.restUnit"/>
        <!-- html:errors property="restUnit"/-->
        <!-- html:text property="restUnit" styleId="restUnit" styleClass="text medium"/-->
            <html:select property="restUnit">
            	<html:options collection="restUnits" property="value" labelProperty="label"/>
            </html:select>
    </li>

    <li>
        <generalsetting:label styleClass="desc" key="restForm.srestUnit"/>
        <html:errors property="srestUnit"/>
        <html:text property="srestUnit" styleId="srestUnit" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="restForm.restHours"/>
        <html:errors property="restHours"/>
        <html:text property="restHours" styleId="restHours" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="restForm.limitDays"/>
        <html:errors property="limitDays"/>
        <html:text property="limitDays" styleId="limitDays" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="restForm.yearLimit"/>
        <html:errors property="yearLimit"/>
        <html:text property="yearLimit" styleId="yearLimit" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="restForm.attachment"/>
        <html:errors property="attachment"/>
        <html:text property="attachment" styleId="attachment" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="restForm.restDescription"/>
        <html:errors property="restDescription"/>
        <html:text property="restDescription" styleId="restDescription" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="restForm.factoryApprove"/>
        <html:errors property="factoryApprove"/>
        <html:text property="factoryApprove" styleId="factoryApprove" styleClass="text medium"/>

    </li>

    <li class="buttonBar bottom">
        <html:submit styleClass="button" property="method.save" onclick="bCancel=false">
            <fmt:message key="button.save"/>
        </html:submit>

        <html:submit styleClass="button" property="method.delete" onclick="bCancel=true; return confirmDelete('Rest')">
            <fmt:message key="button.delete"/>
        </html:submit>

        <html:cancel styleClass="button" onclick="bCancel=true">
            <fmt:message key="button.cancel"/>
        </html:cancel>
    </li>
</ul>
</html:form>

<script type="text/javascript">
    Form.focusFirstElement($("restForm"));
</script>

<html:javascript formName="restForm" cdata="false" dynamicJavascript="true" staticJavascript="false"/>
<script type="text/javascript" src="<html:rewrite page="/scripts/validator.jsp"/>"></script>
